Array.prototype.myMap = function(cb) {
    var _arr = this;
    var _len = _arr.length;
    var _args2 = arguments[1] || window;
    var result = [];

    for(let i = 0; i < _len; i++) {
        var _item = cb.apply(_args2, [_arr[i], i, _arr]);
        result.push(_item);
    }

    return result;
}

function myMap(cb) {
    var _arr = this;
    var _len = _arr.length;
    var _args2 = arguments[1] || window;
    var result = [];

    for(let i = 0; i < _len; i++) {
        var _item = cb.apply(_args2, [_arr[i], i, _arr]);
        result.push(_item);
    }

    return result;    
}